home *** CD-ROM | disk | FTP | other *** search
/ Aminet 38 / Aminet 38 (2000)(Schatztruhe)[!][Aug 2000].iso / Aminet / dev / c / CLib-SDI.lha / CLib-SDI / libsource / examplefuncs.c next >
Encoding:
C/C++ Source or Header  |  2000-06-25  |  1.3 KB  |  48 lines

  1. #ifndef EXAMPLE_EXAMPLEFUNCS_C
  2. #define EXAMPLE_EXAMPLEFUNCS_C
  3.  
  4. /* Programmheader
  5.  
  6.     Name:        examplefuncs.c
  7.     Main:        example
  8.     Versionstring:    $VER: examplefuncs.c 1.0 (25.06.2000)
  9.     Author:        SDI
  10.     Distribution:    Freeware
  11.     Description:    the example library function file
  12.  
  13.  1.0   25.06.00 : created that example library code
  14. */
  15.  
  16. #include <proto/intuition.h>
  17. #include <proto/example.h>
  18. #include "SDI_compiler.h"
  19. #define BASE_REDEFINE    /* either this or BASE_GLOBAL is active */
  20. #include "libinfo.h"
  21.  
  22. /* this one shows how to call own library functions */
  23. ASM(LONG) LIBex_TestRequest(REG(a0, UBYTE *title), REG(a1, UBYTE *body),
  24. REG(a2, UBYTE *gadgets), REG(a6, struct ExampleBaseP *ExampleBase))
  25. {
  26.   return ex_TestRequest2A(title, body, gadgets, NULL);
  27. }
  28.  
  29. /* this one shows how functions with variable argument lists are handled */
  30. ASM(LONG) LIBex_TestRequest2A(REG(a0, STRPTR title), REG(a1, STRPTR body),
  31. REG(a2, STRPTR gadgets), REG(a3, APTR args), REG(a6, struct ExampleBaseP *ExampleBase))
  32. {
  33.   struct EasyStruct estr;
  34.  
  35.   estr.es_StructSize   = sizeof(struct EasyStruct);
  36.   estr.es_Flags        = NULL;
  37.   estr.es_Title        = title;
  38.   estr.es_TextFormat   = body;
  39.   estr.es_GadgetFormat = gadgets;
  40.  
  41.   ++ExampleBase->exb_NumCalls;
  42.  
  43.   return EasyRequestArgs(NULL, &estr, NULL, args);
  44. }
  45.  
  46. #endif /* EXAMPLE_EXAMPLEFUNCS_C */
  47.  
  48.